package com.azdebugit.moshi.test.learn.zhuangshimoshi.test.io;

import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;

//解密类，扩展了FilterOutputStream 类并重写了write方法
public class DesEncryptOutputStream extends FilterOutputStream {
    public DesEncryptOutputStream(OutputStream out) {
        super(out);
    }

    @Override
	public void write(int arg) throws IOException {
        System.out.print(arg+"###");
        arg = arg -2;
        if (arg >= 97 + 26) {
            arg = arg + 26;
        }
        System.out.println(arg);
        super.write(arg);
    }
}